import {LIST_DATA} from '../actions/actionType'

const initState = {
    items:[]
}

const contentListReducer = (state = initState, action) => {
    switch(action.type) {
        case LIST_DATA:
            if (action.page === 0){
                return {...state, items: action.obj.data.poilist}
            } else {
                let list = state.items
                return {...state, items: list.concat(action.obj.data.poilist)}
            }
            
        default: return state
    }
}

export default contentListReducer